<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <div th:replace="~{/fragment/header :: header-nav}"></div>
    <div th:replace="~{/fragment/header :: header}"></div>
    <div th:replace="~{/fragment/header :: header-css}"></div>

</head>
<body>

<form action="/order/save" th:action="@{/order/save}" th:object="${order}" method="post">
    <input th:field="*{id}" type="hidden">

    <div class="mb-3">
        <label for="vehicleId" class="form-label">车辆号牌：</label>
        <select class="form-control" id="vehicleId" name="vehicleId" required>
            <option th:each="vehicle:${vehicle}" th:value="${vehicle.id}" th:text="${vehicle.licencePlate}"></option>
        </select>
    </div>


<!--    <div class="mb-3">-->
<!--        <label for="inDateTime" class="form-label">入场时间：</label>-->
<!--        <input type="text" th:field="*{inDateTime}" class="form-control" id="inDateTime">-->
<!--    </div>-->
    <div class="mb-3">
        入场时间： <h3 th:text="*{#dates.format(inDateTime,'yyyy-MM-dd HH:mm:ss')}"></h3>
    </div>
<!--    判断缴费状态，缴费后方可离场-->
    <div class="mb-3" th:if="*{isPayComplete}">
        离场时间： <h3 th:text="*{#dates.format(outDateTime,'yyyy-MM-dd HH:mm:ss')}"></h3>
    </div>

<!--    <div class="input-group mb-3">-->
<!--        <span class="input-group-text">缴费金额：</span>-->
<!--        <input type="text" th:field="*{price}" class="form-control">-->
<!--    </div>-->

    <div class="mb-3">
        <label for="isPayComplete" class="form-label">是否缴费完成:</label>
        <select class="form-control" id="isPayComplete" name="isPayComplete">
            <option value="true">已缴费</option>
            <option value="false">未缴费</option>
        </select>
    </div>
    <div class="mb-3">
        <label for="isRequireInvoicing" class="form-label">是否开发票</label>
        <select class="form-control" id="isRequireInvoicing" name="isRequireInvoicing">
            <option value="true">开发票</option>
            <option value="false">不开发票</option>
        </select>
    </div>

    <div class="mb-3">
        <label for="parkingLotId" class="form-label">停车场：</label>
        <select class="form-control" id="parkingLotId" name="parkingLotId" required>
            <option th:each="parkingLot:${parkingLots}" th:value="${parkingLot.id}" th:text="${parkingLot.pricingStandard.id}"></option>
        </select>
    </div>

    <div class="mb-3 form-check">
        <input type="checkbox" class="form-check-input" id="exampleCheck1">
        <label class="form-check-label" for="exampleCheck1">检查</label>
    </div>
    <button type="submit" class="btn btn-primary">提交</button>
    <a th:href="@{/order/list}" class="btn-secondary">返回</a>
</form>

<div th:replace="~{/fragment/footer :: footer}"></div>
<div th:replace="~{/fragment/header :: header-js}"></div>

</body>
</html>